﻿using CCWin;
using customer;
using ku;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TelephoneYiShou.XQL
{
    public partial class FrmSaleMain : Skin_Mac
    {
        string loginname;
        public FrmSaleMain(string name)
        {
            InitializeComponent();
            loginname = name;
        }

        private void FrmSaleMain_Load(object sender, EventArgs e)
        {
            string sql = "select commodityname,colour,sum from stock s,commodity c where s.commodityid = c.commodityid and sum<=20";
            DataTable dt = DBHelper.GetDataTable(sql);
            string s = "";
            if (dt.Rows.Count == 0)
            {
                return;
            }
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                s += dt.Rows[i][0].ToString();
                s += " ";
                s += dt.Rows[i][1].ToString();
                s += "，";
            }
            MessageBoxEx.Show(s + "的库存不足20件，请联系管理员及时补充库存", "库存提醒", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        }
        //新增客户
        private void toolStripLabel1_Click(object sender, EventArgs e)
        {
            cusAdd cusadd = new cusAdd();
            cusadd.Show();
        }
        //客户维护
        private void toolStripLabel2_Click(object sender, EventArgs e)
        {
            cusChange cuschange = new cusChange();
            cuschange.Show();
        }
        //查看库存
        private void toolStripLabel5_Click(object sender, EventArgs e)
        {
            FrmInventory frst = new FrmInventory();
            frst.Show();
        }
        //销售出库
        private void toolStripLabel3_Click(object sender, EventArgs e)
        {
            FrmSaleGoods fsg = new FrmSaleGoods(loginname);
            fsg.Show();
        }
        //个人业绩
        private void toolStripLabel4_Click(object sender, EventArgs e)
        {
            FrmEmpperFormance fef = new FrmEmpperFormance(loginname);
            fef.Show();
        }
        //退出系统
        private void toolStripLabel6_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}
